﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using Oracle.DataAccess.Client;

using DTGroup.iNek.Business.AutoAnsync;

namespace DTGroup.iNek.WinUI
{
    public sealed class BaseParameterAutoAnsync
    {
        public static void Import_Site()
        {
            /*
             *              
             F_L_C_ENBFUNCTION_V
                "CITY_NAME" string                    
                "VENDOR_NAME" string
                "ENB_ID" string 
                "ENBFUNCTION_NAME" string
                "LATITUDE" decimal
                "LONGITUDE" decimal
                "COVER_TYPE" string
                "COUNTRY_NAME" string 
                "USER_LABEL" decimal            
             */

            DataTable F_L_C_ENBFUNCTION_V = new DataTable();

            using (OracleConnection connection = new OracleConnection(System.Configuration.ConfigurationManager.ConnectionStrings["OracleConnectionString"].ConnectionString))
            {
                using (OracleCommand command = new OracleCommand())
                {
                    connection.Open();

                    command.Connection = connection;
                    command.CommandText = "select * from F_L_C_ENBFUNCTION_V";
                    command.CommandType = CommandType.Text;

                    OracleDataAdapter dataAdapter = new OracleDataAdapter(command);

                    dataAdapter.Fill(F_L_C_ENBFUNCTION_V);
                }
            }

            BaseParameterAutoAnsync_Site site = new BaseParameterAutoAnsync_Site();
            site.Import(F_L_C_ENBFUNCTION_V);
        }

        public static void Import_Cell()
        {
            /*
             *    
             F_L_C_EUTRANCELLTDD_V
                "CITY_NAME" string 
                "VENDOR_NAME" string 
                "CGI"         string 
                "USER_LABEL"  string 
                "ENB_ID"      string 
                "CELL_LOCAL_ID" decimal
                "EARFCN" decimal
                "PCI"  decimal
                "AZIMUTH" decimal
                "TOTAL_ANGLE" decimal
                "ANT_HEIGHT" decimal
                "TAC"  decimal           
             */

            DataTable F_L_C_EUTRANCELLTDD_V = new DataTable();

            using (OracleConnection connection = new OracleConnection(System.Configuration.ConfigurationManager.ConnectionStrings["OracleConnectionString"].ConnectionString))
            {
                using (OracleCommand command = new OracleCommand())
                {
                    connection.Open();

                    command.Connection = connection;
                    command.CommandText = "select * from F_L_C_EUTRANCELLTDD_V";
                    command.CommandType = CommandType.Text;

                    OracleDataAdapter dataAdapter = new OracleDataAdapter(command);

                    dataAdapter.Fill(F_L_C_EUTRANCELLTDD_V);
                }
            }

            BaseParameterAutoAnsync_Cell cell = new BaseParameterAutoAnsync_Cell();
            cell.Import(F_L_C_EUTRANCELLTDD_V);
        }

        public static void Import_NeighbourCell()
        {
            /*
             *    
             F_L_C_EUTRANRELATIONTDD_V      
                "CITY_NAME" string 
                "VENDOR_NAME" string
                "CGI" string
                "USER_LABEL" string 
                "ADJ_CGI" string
                "ADJ_USER_LABEL"
             */

            DataTable F_L_C_EUTRANRELATIONTDD_V = new DataTable();

            using (OracleConnection connection = new OracleConnection(System.Configuration.ConfigurationManager.ConnectionStrings["OracleConnectionString"].ConnectionString))
            {
                using (OracleCommand command = new OracleCommand())
                {
                    connection.Open();

                    command.Connection = connection;
                    command.CommandText = "select * from F_L_C_EUTRANRELATIONTDD_V";
                    command.CommandType = CommandType.Text;

                    OracleDataAdapter dataAdapter = new OracleDataAdapter(command);

                    dataAdapter.Fill(F_L_C_EUTRANRELATIONTDD_V);
                }
            }

            BaseParameterAutoAnsync_NeighborCell neighbourcell = new BaseParameterAutoAnsync_NeighborCell();
            neighbourcell.Import(F_L_C_EUTRANRELATIONTDD_V);
        }
    }
}
